package com.cppba.mapper.provider;

// 动态生成sql
public class CityMapperProvider {

	public static final String BASE_SELECT = "c.id, c.delete_status, c.name, c.parent_id";

	public String findByParentId(Long parentId) {
		String sql = " SELECT " + BASE_SELECT + " FROM city c  where c.delete_status = 0 ";
		if (parentId != null) {
			sql += " and c.parent_id = #{parentId} ";
		}
		return sql;
	}
}
